﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;

namespace UI.Web.SL.Demo.SysAdmin
{
    public partial class LoginForm : ChildWindow
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            if (Common.ViewUtility.Ask("确定要退出吗") == MessageBoxResult.OK)
            {
                ScriptObject so = HtmlPage.Window.GetProperty("CloseWindow") as ScriptObject;
                so.InvokeSelf();
            }
        }
        private void AutoLoginBox_Click(object sender, RoutedEventArgs e)
        {
            if (AutoLoginBox.IsChecked == true)
            {
                RememberPassWord.IsChecked = true;
                RememberPassWord.IsEnabled = false;
            }
            else
            {
                RememberPassWord.IsEnabled = true;
            }
        }
        private void ChildWindow_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                OKButton_Click(null, null);
            }
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}

